﻿Imports DevBank.Wcf.Interfaces

' NOTE: You can use the "Rename" command on the context menu to change the class name "Service1" in both code and config file together.
<ServiceContract()> _
Public Class SocietaireManager
    Implements ISocietaireManager

    Private Shared db As New DevBank.Model.DevBankEntities

    <OperationContract()> _
    Public Function Save(ByVal societaire As Societaire) As Integer Implements ISocietaireManager.Save

        Dim customer As New DevBank.Model.Customer

        customer.Name = societaire.Nom
        customer.Surname = societaire.Prenom
        customer.DateOfBirth = societaire.DateNaissance

        Try

            Return DevBank.Core.CustomerManager.Create(customer)

        Catch ex As Exception

            'exception wcf
            Return 0

        End Try

    End Function



End Class
